package org.teameleven.quicken.accounts;

import java.math.BigDecimal;
import java.math.MathContext;

public abstract class Account {

	/**
	 * @uml.property  name="amount"
	 */
	protected BigDecimal amount;
	/**
	 * @uml.property  name="interest"
	 */
	private BigDecimal interest;

	public Account(BigDecimal amount, BigDecimal interest) {
		this.amount = amount;
		this.interest = interest;
	}

	/**
	 * @return
	 * @uml.property  name="amount"
	 */
	public BigDecimal getAmount() {
		return amount;
	}

	/**
	 * @param amount
	 * @uml.property  name="amount"
	 */
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	/**
	 * @return
	 * @uml.property  name="interest"
	 */
	public BigDecimal getInterest() {
		return interest;
	}

	/**
	 * @param interest
	 * @uml.property  name="interest"
	 */
	public void setInterest(BigDecimal interest) {
		this.interest = interest;
	}

	public void collectInterest() {
		MathContext mc = new MathContext(2);
		this.amount = amount.multiply(BigDecimal.ONE.add(this.interest)).round(mc);
	}

	//How this account handles paying a bill
	public abstract void payBill(BigDecimal amount);
	
	//How this account handles a deposit
	public abstract void deposit(BigDecimal deposit);
	
	//What automatic monthly deposits are made into the account
	public abstract void makeMonthlyDeposits();
	
	//What montly bills are automatically paid by this account.
	public abstract void payMonthlyBills();

	

}
